package com.alibaba.citrus.cr.order.open.api.facade.common.contant;

import java.util.Objects;

public enum PlanStatusEnum {

    /**
     * 是否关闭：1:代表启用，2:代表关闭，默认1
     */
    Enable("启用", 1),
    CLOSE("关闭", 2),

    ;

    private String desc;
    private Integer type;

    PlanStatusEnum(String desc, Integer type) {
        this.desc = desc;
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public static PlanStatusEnum getByType(Integer type) {
        for (PlanStatusEnum menu : PlanStatusEnum.values()) {
            if (Objects.equals(menu.getType(),type)) {
                return menu;
            }
        }
        return null;
    }
}
